package indi.gao.singleton;

import lombok.Data;

import java.util.Formatter;

/**
 * @author :gaolei
 * @version :v1.0
 * @projectName :GLUtil
 * @description :
 * @createDate :2021/12/3 10:33 下午
 */
@Data
public class PrivateConstructors {

    private static PrivateConstructors privateConstructors = new PrivateConstructors();
    private String arg1;

    private PrivateConstructors() {
        System.out.println("开始私有构造方法");
    }

    public static PrivateConstructors getInstance() {
        System.out.println("获取单例对象");
        return privateConstructors;
    }

    public static void main(String[] args) {
        // 单例测试
        PrivateConstructors instance = PrivateConstructors.getInstance();
    }
}
